1. Field of the Invention
The present invention relates to a picture encoding method of compression-encoding a picture in a few number of bits and a picture decoding method of playing back a picture by decoding a code stream obtained by compression encoding and, more particularly, to a picture encoding method and apparatus and a picture decoding method and apparatus which can make a recovery from the adverse effect of an error as fast as possible without degrading the encoding efficiency when transmitting/storing encoded data through a transmission path susceptible to errors.
2. Description of the Related Art
It is necessary to compression-encode pictures in a few number of bits in order to transmit or store the pictures in systems designed to transmit or store pictures, e.g., a videophone, video conference system, portable information terminal, digital video disk system, and digital TV broadcasting system.
As such compression encoding techniques, various schemes have been developed, including a motion compensation scheme, discrete cosine transform scheme, subband encoding scheme, pyramid encoding scheme, and combinations thereof. The following are defined as international standards for video compression encoding: ISO•MPEG-1, MPEG-2, MPEG-4, ITU-T H.261, H.262, H.263, and the like.
All these schemes are compression encoding schemes based on a combination of motion compensation adaptive prediction and discrete cosine transform, which are described in detail in reference 1 (Hiroshi Yasuda, “MPEG/International Standardization of Multimedia Encoding”, Maruzen) and the like.
A conventional picture encoding/decoding apparatus has the following problems. First, in a communication path with the possibility of being mixed with errors, such as a radio communication path, performing only encoding will lead to considerable deterioration in decoded picture quality upon occurrence of an error. When errors occur in signals such as a sync signal, mode information, and motion vector information, in particular, picture quality noticeably deteriorates.
Second, in motion compensation adaptive predictive encoding used for picture encoding, only the difference between frames is encoded. For this reason, if an error occurs, the corresponding frame fails, and an erroneous picture is stored in a frame memory. A predictive picture is generated by using the erroneous picture, and the residual error is added to the predictive error. As a consequence, even if subsequent frames are properly decoded, proper pictures cannot be obtained from the subsequent frames unless information is sent in an encoding mode (INTRA mode) of encoding pictures only within frames without using the differences between the frames or the influence of the error gradually wanes to restore the original pictures.
If 1-frame information is lost due to an error, the second frame is not decoded at all, and, for example, the first frame is directly output. At the third frame, a residual error which allows proper decoding only when it is added to the second frame is added to the first frame. As a consequence, the third frame is decoded into a picture totally different from the proper picture. Subsequently, residual errors are added to wrong pictures. Basically, therefore, the error does not disappear, and proper decoded pictures cannot be played back.
In order to solve this problem, in the prior art, a technique called “refresh” is generally used, in which encoding is performed in the INTRA mode in a predetermined cycle. When encoding is performed in the INTRA mode, since the number of coded bits increases, the quality of a picture without any error greatly deteriorates. For this reason, a periodic refresh method or the like is usually used, which refreshes several macroblocks per frame instead of refreshing an entire frame at once. In this periodic refresh method, however, although an increase in the number of coded bits can be suppressed, a long period of time is required to recover a normal state.
Other measures against errors include a measure of using error correction codes. Although this scheme can correct errors that occur randomly, it has difficulty in coping with errors of several hundred bits that consecutively occur in a burst manner. Even if the scheme can cope with such errors, considerable redundancy occurs.
Techniques have been studied to receive error information and the like about a network from a system and adaptively process the error information and the like on the server side. More specifically, such a technique uses a method of performing re-encoding upon reception of error information or switching a plurality of files. In this method, the server needs to have an encoding function and a function of adaptively switching a plurality of files, resulting in extra processing.
As described above, according to the conventional picture encoding techniques, loss of information due to an error causes a great deterioration in picture quality. In addition, a technique such as the periodic refresh method of reconstructing information lost due to an error requires a long period of time to achieve error recovery in consideration of the encoding efficiency. Shortening the time required for recovery will increase the number of encoded bits to result in a deterioration in encoding efficiency.